package ExtraDemo.demo02.mycountdownlatch;

import java.util.concurrent.CountDownLatch;

public class MotherThread extends Thread{
    private CountDownLatch countDownLatch;
    public MotherThread(CountDownLatch countDownLatch){
        this.countDownLatch=countDownLatch;
    }
    @Override
    public void run(){
        //1.等待其他孩子吃完
        try {
            countDownLatch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //2.收拾碗筷
        System.out.println("妈妈正在收拾碗筷");
    }
}
